package com.abc.scholarship.domain.vo.resp;

import com.abc.scholarship.domain.entity.ApplyRes;
import com.abc.scholarship.domain.entity.Scholarship;
import com.abc.scholarship.domain.entity.Student;
import com.abc.scholarship.domain.entity.User;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author: LiJunXi
 * @Description:
 * @Date: 2024-07-05  15:03
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ColumnWidth(22)
public class ResultResp {

    @ExcelProperty("学生ID")
    private Long uId;

    @ExcelProperty("奖学金ID")
    private Long scholarshipId;

    @ExcelProperty("奖学金名称")
    private String scholarshipName;

    @ExcelProperty("学生姓名")
    private String uName;

    @ExcelProperty("班级")
    private String className;

    @ExcelProperty("专业")
    private String majorName;

    @ExcelProperty("学院")
    private String collegeName;

    @ExcelProperty("年份")
    private Integer year;

    @ExcelProperty("学号")
    private String uAccount;

    public static ResultResp build(ApplyRes item, User user, Student student, Scholarship scholarship) {
        return new ResultResp(user.getId(), item.getScholarshipId(), scholarship.getScholarshipName(),
                user.getUName(), student.getClassName(), student.getMajorName(), student.getCollegeName(),
                item.getYear(), user.getUAccount());
    }
}
